using HKB.Common;
using System;
using System.CodeDom.Compiler;
using System.ComponentModel;
using System.ComponentModel.Design;
using System.Data;
using System.Data.Common;
using System.Data.SqlClient;
using System.Diagnostics;
namespace HKB.Data.Dal.S_ComplainTableAdapters
{
	[GeneratedCode("System.Data.Design.TypedDataSetGenerator", "2.0.0.0"), DataObject(true), HelpKeyword("vs.data.TableAdapter"), Designer("Microsoft.VSDesigner.DataSource.Design.TableAdapterDesigner, Microsoft.VSDesigner, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"), DesignerCategory("code"), ToolboxItem(true)]
	public class HLShop_ComplainTableAdapter : Component
	{
		private SqlDataAdapter _adapter;
		private SqlConnection _connection;
		private SqlCommand[] _commandCollection;
		private bool _clearBeforeFill;
		[System.Diagnostics.DebuggerNonUserCode]
		private SqlDataAdapter Adapter
		{
			get
			{
				if (this._adapter == null)
				{
					this.InitAdapter();
				}
				return this._adapter;
			}
		}
		[System.Diagnostics.DebuggerNonUserCode]
		internal SqlConnection Connection
		{
			get
			{
				if (this._connection == null)
				{
					this.InitConnection();
				}
				return this._connection;
			}
			set
			{
				this._connection = value;
				if (this.Adapter.InsertCommand != null)
				{
					this.Adapter.InsertCommand.Connection = value;
				}
				if (this.Adapter.DeleteCommand != null)
				{
					this.Adapter.DeleteCommand.Connection = value;
				}
				if (this.Adapter.UpdateCommand != null)
				{
					this.Adapter.UpdateCommand.Connection = value;
				}
				for (int i = 0; i < this.CommandCollection.Length; i++)
				{
					if (this.CommandCollection[i] != null)
					{
						this.CommandCollection[i].Connection = value;
					}
				}
			}
		}
		[System.Diagnostics.DebuggerNonUserCode]
		protected SqlCommand[] CommandCollection
		{
			get
			{
				if (this._commandCollection == null)
				{
					this.InitCommandCollection();
				}
				return this._commandCollection;
			}
		}
		[System.Diagnostics.DebuggerNonUserCode]
		public bool ClearBeforeFill
		{
			get
			{
				return this._clearBeforeFill;
			}
			set
			{
				this._clearBeforeFill = value;
			}
		}
		[System.Diagnostics.DebuggerNonUserCode]
		public HLShop_ComplainTableAdapter()
		{
			this.ClearBeforeFill = true;
		}
		[System.Diagnostics.DebuggerNonUserCode]
		private void InitAdapter()
		{
			this._adapter = new SqlDataAdapter();
			DataTableMapping dataTableMapping = new DataTableMapping();
			dataTableMapping.SourceTable = "Table";
			dataTableMapping.DataSetTable = "HLShop_Complain";
			dataTableMapping.ColumnMappings.Add("ComplainID", "ComplainID");
			dataTableMapping.ColumnMappings.Add("UserID", "UserID");
			dataTableMapping.ColumnMappings.Add("ComplainType", "ComplainType");
			dataTableMapping.ColumnMappings.Add("ComplainUserID", "ComplainUserID");
			dataTableMapping.ColumnMappings.Add("ComplainUserName", "ComplainUserName");
			dataTableMapping.ColumnMappings.Add("Reason", "Reason");
			dataTableMapping.ColumnMappings.Add("Status", "Status");
			dataTableMapping.ColumnMappings.Add("Result", "Result");
			dataTableMapping.ColumnMappings.Add("StartTime", "StartTime");
			this._adapter.TableMappings.Add(dataTableMapping);
			this._adapter.DeleteCommand = new SqlCommand();
			this._adapter.DeleteCommand.Connection = this.Connection;
			this._adapter.DeleteCommand.CommandText = "DELETE FROM [HLShop_Complain] WHERE (([ComplainID] = @Original_ComplainID))";
			this._adapter.DeleteCommand.CommandType = CommandType.Text;
			this._adapter.DeleteCommand.Parameters.Add(new SqlParameter("@Original_ComplainID", SqlDbType.Int, 0, ParameterDirection.Input, 0, 0, "ComplainID", DataRowVersion.Original, false, null, "", "", ""));
			this._adapter.InsertCommand = new SqlCommand();
			this._adapter.InsertCommand.Connection = this.Connection;
			this._adapter.InsertCommand.CommandText = "INSERT INTO [HLShop_Complain] ([UserID], [ComplainType], [ComplainUserID], [ComplainUserName], [Reason], [Status], [Result], [StartTime]) VALUES (@UserID, @ComplainType, @ComplainUserID, @ComplainUserName, @Reason, @Status, @Result, @StartTime)";
			this._adapter.InsertCommand.CommandType = CommandType.Text;
			this._adapter.InsertCommand.Parameters.Add(new SqlParameter("@UserID", SqlDbType.Int, 0, ParameterDirection.Input, 0, 0, "UserID", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.InsertCommand.Parameters.Add(new SqlParameter("@ComplainType", SqlDbType.VarChar, 0, ParameterDirection.Input, 0, 0, "ComplainType", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.InsertCommand.Parameters.Add(new SqlParameter("@ComplainUserID", SqlDbType.Int, 0, ParameterDirection.Input, 0, 0, "ComplainUserID", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.InsertCommand.Parameters.Add(new SqlParameter("@ComplainUserName", SqlDbType.VarChar, 0, ParameterDirection.Input, 0, 0, "ComplainUserName", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.InsertCommand.Parameters.Add(new SqlParameter("@Reason", SqlDbType.Text, 0, ParameterDirection.Input, 0, 0, "Reason", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.InsertCommand.Parameters.Add(new SqlParameter("@Status", SqlDbType.Bit, 0, ParameterDirection.Input, 0, 0, "Status", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.InsertCommand.Parameters.Add(new SqlParameter("@Result", SqlDbType.Text, 0, ParameterDirection.Input, 0, 0, "Result", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.InsertCommand.Parameters.Add(new SqlParameter("@StartTime", SqlDbType.DateTime, 0, ParameterDirection.Input, 0, 0, "StartTime", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.UpdateCommand = new SqlCommand();
			this._adapter.UpdateCommand.Connection = this.Connection;
			this._adapter.UpdateCommand.CommandText = "UPDATE [HLShop_Complain] SET [UserID] = @UserID, [ComplainType] = @ComplainType, [ComplainUserID] = @ComplainUserID, [ComplainUserName] = @ComplainUserName, [Reason] = @Reason, [Status] = @Status, [Result] = @Result, [StartTime] = @StartTime WHERE (([ComplainID] = @Original_ComplainID))";
			this._adapter.UpdateCommand.CommandType = CommandType.Text;
			this._adapter.UpdateCommand.Parameters.Add(new SqlParameter("@UserID", SqlDbType.Int, 0, ParameterDirection.Input, 0, 0, "UserID", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.UpdateCommand.Parameters.Add(new SqlParameter("@ComplainType", SqlDbType.VarChar, 0, ParameterDirection.Input, 0, 0, "ComplainType", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.UpdateCommand.Parameters.Add(new SqlParameter("@ComplainUserID", SqlDbType.Int, 0, ParameterDirection.Input, 0, 0, "ComplainUserID", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.UpdateCommand.Parameters.Add(new SqlParameter("@ComplainUserName", SqlDbType.VarChar, 0, ParameterDirection.Input, 0, 0, "ComplainUserName", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.UpdateCommand.Parameters.Add(new SqlParameter("@Reason", SqlDbType.Text, 0, ParameterDirection.Input, 0, 0, "Reason", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.UpdateCommand.Parameters.Add(new SqlParameter("@Status", SqlDbType.Bit, 0, ParameterDirection.Input, 0, 0, "Status", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.UpdateCommand.Parameters.Add(new SqlParameter("@Result", SqlDbType.Text, 0, ParameterDirection.Input, 0, 0, "Result", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.UpdateCommand.Parameters.Add(new SqlParameter("@StartTime", SqlDbType.DateTime, 0, ParameterDirection.Input, 0, 0, "StartTime", DataRowVersion.Current, false, null, "", "", ""));
			this._adapter.UpdateCommand.Parameters.Add(new SqlParameter("@Original_ComplainID", SqlDbType.Int, 0, ParameterDirection.Input, 0, 0, "ComplainID", DataRowVersion.Original, false, null, "", "", ""));
		}
		[System.Diagnostics.DebuggerNonUserCode]
		private void InitConnection()
		{
			this._connection = new SqlConnection();
			this._connection.ConnectionString = Conn.CurrenConnectionStrings;
		}
		[System.Diagnostics.DebuggerNonUserCode]
		private void InitCommandCollection()
		{
			this._commandCollection = new SqlCommand[4];
			this._commandCollection[0] = new SqlCommand();
			this._commandCollection[0].Connection = this.Connection;
			this._commandCollection[0].CommandText = "SELECT HLShop_Complain.*\r\nFROM HLShop_Complain";
			this._commandCollection[0].CommandType = CommandType.Text;
			this._commandCollection[1] = new SqlCommand();
			this._commandCollection[1].Connection = this.Connection;
			this._commandCollection[1].CommandText = "SELECT ComplainID, UserID, ComplainType, ComplainUserID, ComplainUserName, \r\n      Reason, Status, Result, StartTime\r\nFROM HLShop_Complain\r\nWHERE (ComplainID = @ComplainID)";
			this._commandCollection[1].CommandType = CommandType.Text;
			this._commandCollection[1].Parameters.Add(new SqlParameter("@ComplainID", SqlDbType.Int, 4, ParameterDirection.Input, 0, 0, "ComplainID", DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[2] = new SqlCommand();
			this._commandCollection[2].Connection = this.Connection;
			this._commandCollection[2].CommandText = "PR_GetComplainByStatusUserIDComplainUserIDLatelyDateComplainType";
			this._commandCollection[2].CommandType = CommandType.StoredProcedure;
			this._commandCollection[2].Parameters.Add(new SqlParameter("@RETURN_VALUE", SqlDbType.Int, 4, ParameterDirection.ReturnValue, 10, 0, null, DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[2].Parameters.Add(new SqlParameter("@Status", SqlDbType.VarChar, 20, ParameterDirection.Input, 0, 0, null, DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[2].Parameters.Add(new SqlParameter("@UserID", SqlDbType.Int, 4, ParameterDirection.Input, 10, 0, null, DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[2].Parameters.Add(new SqlParameter("@ComplainUserID", SqlDbType.Int, 4, ParameterDirection.Input, 10, 0, null, DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[2].Parameters.Add(new SqlParameter("@LatelyDate", SqlDbType.VarChar, 20, ParameterDirection.Input, 0, 0, null, DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[2].Parameters.Add(new SqlParameter("@ComplainType", SqlDbType.VarChar, 20, ParameterDirection.Input, 0, 0, null, DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[3] = new SqlCommand();
			this._commandCollection[3].Connection = this.Connection;
			this._commandCollection[3].CommandText = "INSERT INTO HLShop_Complain\r\n      (UserID, ComplainType, ComplainUserID, ComplainUserName, Reason, Status, \r\n      Result, StartTime,username)\r\nVALUES (@UserID,@ComplainType,@ComplainUserID,@ComplainUserName,@Reason,@Status,@Result,@StartTime,@username)";
			this._commandCollection[3].CommandType = CommandType.Text;
			this._commandCollection[3].Parameters.Add(new SqlParameter("@UserID", SqlDbType.Int, 4, ParameterDirection.Input, 0, 0, "UserID", DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[3].Parameters.Add(new SqlParameter("@ComplainType", SqlDbType.VarChar, 50, ParameterDirection.Input, 0, 0, "ComplainType", DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[3].Parameters.Add(new SqlParameter("@ComplainUserID", SqlDbType.Int, 4, ParameterDirection.Input, 0, 0, "ComplainUserID", DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[3].Parameters.Add(new SqlParameter("@ComplainUserName", SqlDbType.VarChar, 50, ParameterDirection.Input, 0, 0, "ComplainUserName", DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[3].Parameters.Add(new SqlParameter("@Reason", SqlDbType.Text, 2147483647, ParameterDirection.Input, 0, 0, "Reason", DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[3].Parameters.Add(new SqlParameter("@Status", SqlDbType.Bit, 1, ParameterDirection.Input, 0, 0, "Status", DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[3].Parameters.Add(new SqlParameter("@Result", SqlDbType.Text, 2147483647, ParameterDirection.Input, 0, 0, "Result", DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[3].Parameters.Add(new SqlParameter("@StartTime", SqlDbType.DateTime, 8, ParameterDirection.Input, 0, 0, "StartTime", DataRowVersion.Current, false, null, "", "", ""));
			this._commandCollection[3].Parameters.Add(new SqlParameter("@username", SqlDbType.VarChar, 50, ParameterDirection.Input, 0, 0, "UserName", DataRowVersion.Current, false, null, "", "", ""));
		}
		[DataObjectMethod(DataObjectMethodType.Fill, true), HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual int Fill(S_Complain.HLShop_ComplainDataTable dataTable)
		{
			this.Adapter.SelectCommand = this.CommandCollection[0];
			if (this.ClearBeforeFill)
			{
				dataTable.Clear();
			}
			return this.Adapter.Fill(dataTable);
		}
		[DataObjectMethod(DataObjectMethodType.Select, true), HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual S_Complain.HLShop_ComplainDataTable GetAllComplain()
		{
			this.Adapter.SelectCommand = this.CommandCollection[0];
			S_Complain.HLShop_ComplainDataTable hLShop_ComplainDataTable = new S_Complain.HLShop_ComplainDataTable();
			this.Adapter.Fill(hLShop_ComplainDataTable);
			return hLShop_ComplainDataTable;
		}
		[DataObjectMethod(DataObjectMethodType.Select, false), HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual S_Complain.HLShop_ComplainDataTable GetComplainByComplainID(int ComplainID)
		{
			this.Adapter.SelectCommand = this.CommandCollection[1];
			this.Adapter.SelectCommand.Parameters[0].Value = ComplainID;
			S_Complain.HLShop_ComplainDataTable hLShop_ComplainDataTable = new S_Complain.HLShop_ComplainDataTable();
			this.Adapter.Fill(hLShop_ComplainDataTable);
			return hLShop_ComplainDataTable;
		}
		[DataObjectMethod(DataObjectMethodType.Fill, false), HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual int GetComplainByStatusUserIDComplainUserIDLatelyDateComplaintype1(S_Complain.HLShop_ComplainDataTable dataTable, string Status, int? UserID, int? ComplainUserID, string LatelyDate, string ComplainType)
		{
			this.Adapter.SelectCommand = this.CommandCollection[2];
			if (Status == null)
			{
				this.Adapter.SelectCommand.Parameters[1].Value = System.DBNull.Value;
			}
			else
			{
				this.Adapter.SelectCommand.Parameters[1].Value = Status;
			}
			if (UserID.HasValue)
			{
				this.Adapter.SelectCommand.Parameters[2].Value = UserID.Value;
			}
			else
			{
				this.Adapter.SelectCommand.Parameters[2].Value = System.DBNull.Value;
			}
			if (ComplainUserID.HasValue)
			{
				this.Adapter.SelectCommand.Parameters[3].Value = ComplainUserID.Value;
			}
			else
			{
				this.Adapter.SelectCommand.Parameters[3].Value = System.DBNull.Value;
			}
			if (LatelyDate == null)
			{
				this.Adapter.SelectCommand.Parameters[4].Value = System.DBNull.Value;
			}
			else
			{
				this.Adapter.SelectCommand.Parameters[4].Value = LatelyDate;
			}
			if (ComplainType == null)
			{
				this.Adapter.SelectCommand.Parameters[5].Value = System.DBNull.Value;
			}
			else
			{
				this.Adapter.SelectCommand.Parameters[5].Value = ComplainType;
			}
			if (this.ClearBeforeFill)
			{
				dataTable.Clear();
			}
			return this.Adapter.Fill(dataTable);
		}
		[DataObjectMethod(DataObjectMethodType.Select, false), HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual S_Complain.HLShop_ComplainDataTable GetComplainByStatusUserIDComplainUserIDLatelyDateComplaintype(string Status, int? UserID, int? ComplainUserID, string LatelyDate, string ComplainType)
		{
			this.Adapter.SelectCommand = this.CommandCollection[2];
			if (Status == null)
			{
				this.Adapter.SelectCommand.Parameters[1].Value = System.DBNull.Value;
			}
			else
			{
				this.Adapter.SelectCommand.Parameters[1].Value = Status;
			}
			if (UserID.HasValue)
			{
				this.Adapter.SelectCommand.Parameters[2].Value = UserID.Value;
			}
			else
			{
				this.Adapter.SelectCommand.Parameters[2].Value = System.DBNull.Value;
			}
			if (ComplainUserID.HasValue)
			{
				this.Adapter.SelectCommand.Parameters[3].Value = ComplainUserID.Value;
			}
			else
			{
				this.Adapter.SelectCommand.Parameters[3].Value = System.DBNull.Value;
			}
			if (LatelyDate == null)
			{
				this.Adapter.SelectCommand.Parameters[4].Value = System.DBNull.Value;
			}
			else
			{
				this.Adapter.SelectCommand.Parameters[4].Value = LatelyDate;
			}
			if (ComplainType == null)
			{
				this.Adapter.SelectCommand.Parameters[5].Value = System.DBNull.Value;
			}
			else
			{
				this.Adapter.SelectCommand.Parameters[5].Value = ComplainType;
			}
			S_Complain.HLShop_ComplainDataTable hLShop_ComplainDataTable = new S_Complain.HLShop_ComplainDataTable();
			this.Adapter.Fill(hLShop_ComplainDataTable);
			return hLShop_ComplainDataTable;
		}
		[HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual int Update(S_Complain.HLShop_ComplainDataTable dataTable)
		{
			return this.Adapter.Update(dataTable);
		}
		[HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual int Update(S_Complain dataSet)
		{
			return this.Adapter.Update(dataSet, "HLShop_Complain");
		}
		[HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual int Update(DataRow dataRow)
		{
			return this.Adapter.Update(new DataRow[]
			{
				dataRow
			});
		}
		[HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual int Update(DataRow[] dataRows)
		{
			return this.Adapter.Update(dataRows);
		}
		[DataObjectMethod(DataObjectMethodType.Delete, true), HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual int Delete(int Original_ComplainID)
		{
			this.Adapter.DeleteCommand.Parameters[0].Value = Original_ComplainID;
			ConnectionState state = this.Adapter.DeleteCommand.Connection.State;
			if ((this.Adapter.DeleteCommand.Connection.State & ConnectionState.Open) != ConnectionState.Open)
			{
				this.Adapter.DeleteCommand.Connection.Open();
			}
			int result;
			try
			{
				int num = this.Adapter.DeleteCommand.ExecuteNonQuery();
				result = num;
			}
			finally
			{
				if (state == ConnectionState.Closed)
				{
					this.Adapter.DeleteCommand.Connection.Close();
				}
			}
			return result;
		}
		[DataObjectMethod(DataObjectMethodType.Insert, true), HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual int Insert(int? UserID, string ComplainType, int? ComplainUserID, string ComplainUserName, string Reason, bool? Status, string Result, System.DateTime? StartTime)
		{
			if (UserID.HasValue)
			{
				this.Adapter.InsertCommand.Parameters[0].Value = UserID.Value;
			}
			else
			{
				this.Adapter.InsertCommand.Parameters[0].Value = System.DBNull.Value;
			}
			if (ComplainType == null)
			{
				this.Adapter.InsertCommand.Parameters[1].Value = System.DBNull.Value;
			}
			else
			{
				this.Adapter.InsertCommand.Parameters[1].Value = ComplainType;
			}
			if (ComplainUserID.HasValue)
			{
				this.Adapter.InsertCommand.Parameters[2].Value = ComplainUserID.Value;
			}
			else
			{
				this.Adapter.InsertCommand.Parameters[2].Value = System.DBNull.Value;
			}
			if (ComplainUserName == null)
			{
				this.Adapter.InsertCommand.Parameters[3].Value = System.DBNull.Value;
			}
			else
			{
				this.Adapter.InsertCommand.Parameters[3].Value = ComplainUserName;
			}
			if (Reason == null)
			{
				this.Adapter.InsertCommand.Parameters[4].Value = System.DBNull.Value;
			}
			else
			{
				this.Adapter.InsertCommand.Parameters[4].Value = Reason;
			}
			if (Status.HasValue)
			{
				this.Adapter.InsertCommand.Parameters[5].Value = Status.Value;
			}
			else
			{
				this.Adapter.InsertCommand.Parameters[5].Value = System.DBNull.Value;
			}
			if (Result == null)
			{
				this.Adapter.InsertCommand.Parameters[6].Value = System.DBNull.Value;
			}
			else
			{
				this.Adapter.InsertCommand.Parameters[6].Value = Result;
			}
			if (StartTime.HasValue)
			{
				this.Adapter.InsertCommand.Parameters[7].Value = StartTime.Value;
			}
			else
			{
				this.Adapter.InsertCommand.Parameters[7].Value = System.DBNull.Value;
			}
			ConnectionState state = this.Adapter.InsertCommand.Connection.State;
			if ((this.Adapter.InsertCommand.Connection.State & ConnectionState.Open) != ConnectionState.Open)
			{
				this.Adapter.InsertCommand.Connection.Open();
			}
			int result;
			try
			{
				int num = this.Adapter.InsertCommand.ExecuteNonQuery();
				result = num;
			}
			finally
			{
				if (state == ConnectionState.Closed)
				{
					this.Adapter.InsertCommand.Connection.Close();
				}
			}
			return result;
		}
		[DataObjectMethod(DataObjectMethodType.Update, true), HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual int Update(int? UserID, string ComplainType, int? ComplainUserID, string ComplainUserName, string Reason, bool? Status, string Result, System.DateTime? StartTime, int Original_ComplainID)
		{
			if (UserID.HasValue)
			{
				this.Adapter.UpdateCommand.Parameters[0].Value = UserID.Value;
			}
			else
			{
				this.Adapter.UpdateCommand.Parameters[0].Value = System.DBNull.Value;
			}
			if (ComplainType == null)
			{
				this.Adapter.UpdateCommand.Parameters[1].Value = System.DBNull.Value;
			}
			else
			{
				this.Adapter.UpdateCommand.Parameters[1].Value = ComplainType;
			}
			if (ComplainUserID.HasValue)
			{
				this.Adapter.UpdateCommand.Parameters[2].Value = ComplainUserID.Value;
			}
			else
			{
				this.Adapter.UpdateCommand.Parameters[2].Value = System.DBNull.Value;
			}
			if (ComplainUserName == null)
			{
				this.Adapter.UpdateCommand.Parameters[3].Value = System.DBNull.Value;
			}
			else
			{
				this.Adapter.UpdateCommand.Parameters[3].Value = ComplainUserName;
			}
			if (Reason == null)
			{
				this.Adapter.UpdateCommand.Parameters[4].Value = System.DBNull.Value;
			}
			else
			{
				this.Adapter.UpdateCommand.Parameters[4].Value = Reason;
			}
			if (Status.HasValue)
			{
				this.Adapter.UpdateCommand.Parameters[5].Value = Status.Value;
			}
			else
			{
				this.Adapter.UpdateCommand.Parameters[5].Value = System.DBNull.Value;
			}
			if (Result == null)
			{
				this.Adapter.UpdateCommand.Parameters[6].Value = System.DBNull.Value;
			}
			else
			{
				this.Adapter.UpdateCommand.Parameters[6].Value = Result;
			}
			if (StartTime.HasValue)
			{
				this.Adapter.UpdateCommand.Parameters[7].Value = StartTime.Value;
			}
			else
			{
				this.Adapter.UpdateCommand.Parameters[7].Value = System.DBNull.Value;
			}
			this.Adapter.UpdateCommand.Parameters[8].Value = Original_ComplainID;
			ConnectionState state = this.Adapter.UpdateCommand.Connection.State;
			if ((this.Adapter.UpdateCommand.Connection.State & ConnectionState.Open) != ConnectionState.Open)
			{
				this.Adapter.UpdateCommand.Connection.Open();
			}
			int result;
			try
			{
				int num = this.Adapter.UpdateCommand.ExecuteNonQuery();
				result = num;
			}
			finally
			{
				if (state == ConnectionState.Closed)
				{
					this.Adapter.UpdateCommand.Connection.Close();
				}
			}
			return result;
		}
		[DataObjectMethod(DataObjectMethodType.Insert, false), HelpKeyword("vs.data.TableAdapter"), System.Diagnostics.DebuggerNonUserCode]
		public virtual int InsertComplain(int? UserID, string ComplainType, int? ComplainUserID, string ComplainUserName, string Reason, bool? Status, string Result, System.DateTime? StartTime, string username)
		{
			SqlCommand sqlCommand = this.CommandCollection[3];
			if (UserID.HasValue)
			{
				sqlCommand.Parameters[0].Value = UserID.Value;
			}
			else
			{
				sqlCommand.Parameters[0].Value = System.DBNull.Value;
			}
			if (ComplainType == null)
			{
				sqlCommand.Parameters[1].Value = System.DBNull.Value;
			}
			else
			{
				sqlCommand.Parameters[1].Value = ComplainType;
			}
			if (ComplainUserID.HasValue)
			{
				sqlCommand.Parameters[2].Value = ComplainUserID.Value;
			}
			else
			{
				sqlCommand.Parameters[2].Value = System.DBNull.Value;
			}
			if (ComplainUserName == null)
			{
				sqlCommand.Parameters[3].Value = System.DBNull.Value;
			}
			else
			{
				sqlCommand.Parameters[3].Value = ComplainUserName;
			}
			if (Reason == null)
			{
				sqlCommand.Parameters[4].Value = System.DBNull.Value;
			}
			else
			{
				sqlCommand.Parameters[4].Value = Reason;
			}
			if (Status.HasValue)
			{
				sqlCommand.Parameters[5].Value = Status.Value;
			}
			else
			{
				sqlCommand.Parameters[5].Value = System.DBNull.Value;
			}
			if (Result == null)
			{
				sqlCommand.Parameters[6].Value = System.DBNull.Value;
			}
			else
			{
				sqlCommand.Parameters[6].Value = Result;
			}
			if (StartTime.HasValue)
			{
				sqlCommand.Parameters[7].Value = StartTime.Value;
			}
			else
			{
				sqlCommand.Parameters[7].Value = System.DBNull.Value;
			}
			if (username == null)
			{
				sqlCommand.Parameters[8].Value = System.DBNull.Value;
			}
			else
			{
				sqlCommand.Parameters[8].Value = username;
			}
			ConnectionState state = sqlCommand.Connection.State;
			if ((sqlCommand.Connection.State & ConnectionState.Open) != ConnectionState.Open)
			{
				sqlCommand.Connection.Open();
			}
			int result;
			try
			{
				result = sqlCommand.ExecuteNonQuery();
			}
			finally
			{
				if (state == ConnectionState.Closed)
				{
					sqlCommand.Connection.Close();
				}
			}
			return result;
		}
	}
}
